# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=wget
pkgver=1.19.1
pkgrel=2
pkgdesc="A network utility to retrieve files from the Web"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/wget/wget.html"
license=('GPL3')
depends=('gnutls' 'libidn' 'libutil-linux' 'libpsl' 'pcre')
checkdepends=('perl-http-daemon' 'perl-io-socket-ssl' 'python')
optdepends=('ca-certificates: HTTPS downloads')
backup=('etc/wgetrc')
source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig})
sha1sums=('cde25e99c144191644406793cbd1c69c102c6970'
          'SKIP')
validpgpkeys=('AC404C1C0BF735C63FF4D562263D6DF2E163E1EA'
              '1CB27DBC98614B2D5841646D08302DB6A2670428') # Tim Rühsen <tim.ruehsen@gmx.de>

prepare() {
  cd ${pkgname}-${pkgver}
  cat >> doc/sample.wgetrc <<EOF

# default root certs location
ca_certificate=/etc/ssl/certs/ca-certificates.crt
EOF
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc --enable-nls --with-ssl=gnutls
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
